package edu.whu.xterm.activity;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import android.os.Environment;

public class FileWriteAccess {

	private static File dir = Environment.getExternalStorageDirectory();

	public static void write(String name, String str) {
		File f = new File(dir, name);
		FileWriter writer = null;
		try {
			writer = new FileWriter(f);
			writer.write(str);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
				}
			}
		}
	}

}
